package com.zy.dp.iterator.example7;

import java.util.Collection;
import java.util.Iterator;

public class Client
{
	@SuppressWarnings("rawtypes")
	public static void main(String[] args)
	{

		SalaryManager salaryManager = new SalaryManager();
		salaryManager.calcSalary();
		AggregationIterator it = salaryManager.createIterator();
		Collection col = it.next(2);
		print(col);
		Collection col2 = it.next(2);
		print(col2);

		Collection col3 = it.previous(2);
		print(col3);

	}

	@SuppressWarnings("rawtypes")
	private static void print(Collection col)

	{
		Iterator it = col.iterator();

		while (it.hasNext())
		{
			Object obj = it.next();
			System.out.println(obj);
		}

	}

}
